(use-package lsp-mode
  :ensure
  :commands lsp
  :custom
  (lsp-keymap-prefix "C-c l")
  ;; (lsp-eldoc-render-all t)
  (lsp-idle-delay 0.1)
  (lsp-enable-semantic-highlighting t)
  (gc-cons-threshold (* 80 1024 1024))
  (read-process-output-max (* 1024 1024))
  :config
  (add-hook 'lsp-mode-hook 'lsp-ui-mode))
(use-package lsp-ui
  :ensure t
  :commands lsp-ui-mode
  :bind
  (:map lsp-ui-mode-map
        ("C-c C-f" . lsp-ui-doc-focus-frame)
        ("C-c C-m" . lsp-ui-imenu)
        ("C-c C-r" . lsp-find-references))
  :hook
  ((python-mode . lsp))
  :custom
  (lsp-ui-flycheck-list-position 'right)
  (lsp-ui-sideline-show-diagnostics t)
  (lsp-ui-sideline-show-hover t)
  (lsp-ui-sideline-show-code-actions t)
  (lsp-ui-sideline-update-mode 'line)
  (lsp-ui-sideline-diagnostic-max-line-length 80)
  (lsp-ui-peek-enable t)
  (lsp-ui-peek-show-directory t)
  ;; (lsp-ui-doc-use-webkit t)
  ;; (lsp-ui-doc-webkit-max-width-px 300)
  (lsp-ui-doc-max-width 80)
  (lsp-ui-doc-alignment 'window)
  (lsp-ui-doc-position 'point)
  (lsp-ui-doc-show-with-cursor t)
  (lsp-ui-doc-show-with-mouse t)
  (lsp-ui-doc-enable t)
  (lsp-ui-imenu-enable t)
  (lsp-ui-imenu-auto-refresh t)
  (lsp-ui-imenu-window-width 20))
(use-package dap-mode
  :commands dap-mode)
(provide 'init_lsp)
